import request from '@/utils/request';

// post
export function postAction(url, parameter) {
    return request({
        url: url,
        method: 'post',
        data: parameter,
    });
}

//post method = {post | put}
export function httpAction(url, parameter, method) {
    return request({
        url: url,
        method: method,
        data: parameter,
    });
}

//put
export function putAction(url, parameter) {
    return request({
        url: url,
        method: 'put',
        data: parameter,
    });
}

//get
export function getAction(url, parameter) {
    return request({
        url: url,
        method: 'get',
        params: parameter,
    });
}

//delete
export function deleteAction(url, parameter) {
    return request({
        url: url,
        method: 'delete',
        data: parameter,
    });
}

//post 路由传参post请求
export function CtpAction(url, parameter) {
    return axios({
        url: url,
        method: 'post',
        params: parameter
    })
}

//post 表单传参post请求
export function CtpActionMap(url, parameter) {
    return axios({
        url: url,
        method: 'post',
        data: parameter
    })
}